package com.GUI.Lesson06;
//列表
import javax.swing.*;
import java.awt.*;
import java.util.Vector;

public class TextComboboxDemo02 extends JFrame {
    public TextComboboxDemo02(){
        Container container = this.getContentPane();
        //生成列表(静态)
        //String[] contents = {"1","2","3"};

        //在列表中加入动态的数据
        Vector contents = new Vector();
        contents.add("4");
        contents.add("5");
        contents.add("6");

        //在列表中放入内容
        JList jList = new JList(contents);

        container.add(jList);
        //基本
        this.setVisible(true);
        this.setBounds(10,10,200,200);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    }

    public static void main(String[] args) {
        new TextComboboxDemo02();
    }
}
